package com.allwees.bs.module.mms.bo;

import com.allwees.bs.module.core.constant.EWithdrawAccountChannel;
import com.allwees.bs.module.mms.entity.Retailer;
import com.allwees.bs.module.mms.entity.RetailerApply;
import com.allwees.core.common.constant.EWithdrawAccountType;
import lombok.Data;

import java.io.Serializable;

@Data
public class MerchantCreatedBo implements Serializable {

    private String uuid;

    private EWithdrawAccountChannel channel;
    private EWithdrawAccountType accountType;

    private String accountNo;
    private String bankCode;
    private String bankName;
    private String bankProvince;
    private String bankCity;
    private String bankArea;
    private String branchBankLocation;
    private String branchBank;
    private String mobile;

    private String accountOwnerName;
    private String accountOwnerIdNo;

    public static MerchantCreatedBo of(Retailer retailer, RetailerApply apply) {
        MerchantCreatedBo bo = new MerchantCreatedBo();
        bo.setAccountNo(apply.getAccountNo());
        bo.setBankCode(apply.getBankCode());
        bo.setBankName(apply.getBankName());
        bo.setBranchBank(apply.getBranchBank());
        bo.setBranchBankLocation(apply.getBranchBankLocation());
        bo.setChannel(apply.getChannel());
        bo.setAccountType(apply.getAccountType());
        bo.setUuid(retailer.getUuid());
        bo.setMobile(retailer.getPhone());
        bo.setAccountOwnerName(apply.getAccountOwnerName());
        bo.setAccountOwnerIdNo(apply.getAccountOwnerIdNo());

        return bo;
    }
}
